#include <stdio.h>
#include<stdlib.h>
#include <assert.h>
#include<string.h>
 
char *my_strncat(char *dest, const char*src, int count)
{
    char*ret =dest;
    assert(dest!=NULL);
    assert(src!=NULL);
    
    while(*dest)
    {
        dest++;
    }
    while(count--)
    {
        *dest++= *src++;
    }
    *dest='\0';
    return  (char*)ret;
}
 
int main()
{
    char arr[20] = "hello";
    char *p = " bit";
    printf("%s\n",my_strncat(arr, p, 4));
    system("pause");
    return 0;
}


